﻿<views:MvxWinRTPage x:Class="Conference.UX.WinRT.Views.SpeakerListEntityView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:views="using:Cirrious.MvvmCross.WinRT.Views"
                    xmlns:tcl="using:TeaLightV5.Foundation.UX.WinRT.Controls"
                    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Command="{Binding CloseCommand}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>

        <ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Data}" HorizontalContentAlignment="Stretch" >
            <ListBox.ItemTemplate>
                <DataTemplate >
                    <tcl:StackPanel TapCommand="{Binding ReadCommand}" >
                        <tcl:StackPanel DataContext="{Binding Data}" >
                            <TextBlock Text="{Binding Name, Mode=TwoWay}" />
                            <TextBlock Text="{Binding Title}" TextWrapping="Wrap"/>
                        </tcl:StackPanel>
                    </tcl:StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
        <StackPanel Grid.Row="2" Orientation="Horizontal" >
            <Button Content="Add" Command="{Binding AddCommand}"/>
            <Button Content="Refresh" Command="{Binding RefreshCommand}"/>
        </StackPanel>
    </Grid>
</views:MvxWinRTPage>